const http = require('https');
const fs = require('fs');

const options = {
  method: 'POST',
  hostname: 'devtool.tech',
  port: null,
  path: '/api/html-md',
  headers: {
    Accept: '*/*',
    'User-Agent': 'Thunder Client (https://www.thunderclient.com)',
    'Content-Type': 'application/json',
  },
};

const list = [
  {
    index: '0',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744',
    title: 'Java教程',
    catalog: '',
  },
  {
    index: '1',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255883772263712',
    title: 'Java快速入门',
    catalog: '1',
  },
  {
    index: '2',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255876875896416',
    title: 'Java历史',
    catalog: '1.1',
  },
  {
    index: '3',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1280507291631649',
    title: '安装JDK',
    catalog: '1.1.1',
  },
  {
    index: '4',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255878730977024',
    title: '第一个Java程序',
    catalog: '1.1.2',
  },
  {
    index: '5',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1252598088725056',
    title: 'Java代码助手',
    catalog: '1.1.3',
  },
  {
    index: '6',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255883818398144',
    title: '使用IDE',
    catalog: '1.1.4',
  },
  {
    index: '7',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1266092093733664',
    title: '使用IDE练习插件',
    catalog: '1.1.5',
  },
  {
    index: '8',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255884091031392',
    title: 'Java程序基础',
    catalog: '1.2',
  },
  {
    index: '9',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255884132971296',
    title: 'Java程序基本结构',
    catalog: '1.2.1',
  },
  {
    index: '10',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255883729079552',
    title: '变量和数据类型',
    catalog: '1.2.2',
  },
  {
    index: '11',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255888634635520',
    title: '整数运算',
    catalog: '1.2.3',
  },
  {
    index: '12',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255887847679616',
    title: '浮点数运算',
    catalog: '1.2.4',
  },
  {
    index: '13',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255938640048480',
    title: '布尔运算',
    catalog: '1.2.5',
  },
  {
    index: '14',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255938912141568',
    title: '字符和字符串',
    catalog: '1.2.6',
  },
  {
    index: '15',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255941599809248',
    title: '数组类型',
    catalog: '1.2.7',
  },
  {
    index: '16',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255943455934400',
    title: '流程控制',
    catalog: '1.3',
  },
  {
    index: '17',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255887264020640',
    title: '输入和输出',
    catalog: '1.3.1',
  },
  {
    index: '18',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1259539352677728',
    title: 'if判断',
    catalog: '1.3.2',
  },
  {
    index: '19',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1259541030848864',
    title: 'switch多重选择',
    catalog: '1.3.3',
  },
  {
    index: '20',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1259539701691232',
    title: 'while循环',
    catalog: '1.3.4',
  },
  {
    index: '21',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1259541649945472',
    title: 'do while循环',
    catalog: '1.3.5',
  },
  {
    index: '22',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1259540152578912',
    title: 'for循环',
    catalog: '1.3.6',
  },
  {
    index: '23',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1259542531392800',
    title: 'break和continue',
    catalog: '1.3.7',
  },
  {
    index: '24',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255945064769408',
    title: '数组操作',
    catalog: '1.4',
  },
  {
    index: '25',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1259542828545952',
    title: '遍历数组',
    catalog: '1.4.1',
  },
  {
    index: '26',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1259543088592672',
    title: '数组排序',
    catalog: '1.4.2',
  },
  {
    index: '27',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1259544232593792',
    title: '多维数组',
    catalog: '1.4.3',
  },
  {
    index: '28',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1259544070059520',
    title: '命令行参数',
    catalog: '1.4.4',
  },
  {
    index: '29',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255943520012800',
    title: '面向对象编程',
    catalog: '2',
  },
  {
    index: '30',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260451488854880',
    title: '面向对象基础',
    catalog: '2.1',
  },
  {
    index: '31',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260452774408320',
    title: '方法',
    catalog: '2.1.1',
  },
  {
    index: '32',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260454185794944',
    title: '构造方法',
    catalog: '2.1.2',
  },
  {
    index: '33',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260454256258656',
    title: '方法重载',
    catalog: '2.1.3',
  },
  {
    index: '34',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260454548196032',
    title: '继承',
    catalog: '2.1.4',
  },
  {
    index: '35',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260455778791232',
    title: '多态',
    catalog: '2.1.5',
  },
  {
    index: '36',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260456371027744',
    title: '抽象类',
    catalog: '2.1.6',
  },
  {
    index: '37',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260456790454816',
    title: '接口',
    catalog: '2.1.7',
  },
  {
    index: '38',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260464690677856',
    title: '静态字段和静态方法',
    catalog: '2.1.8',
  },
  {
    index: '39',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260467032946976',
    title: '包',
    catalog: '2.1.9',
  },
  {
    index: '40',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260466215676512',
    title: '作用域',
    catalog: '2.1.10',
  },
  {
    index: '41',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1376414781669409',
    title: '内部类',
    catalog: '2.1.11',
  },
  {
    index: '42',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260466914339296',
    title: 'classpath和jar',
    catalog: '2.1.12',
  },
  {
    index: '43',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1476084948271136',
    title: 'class版本',
    catalog: '2.1.13',
  },
  {
    index: '44',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281795926523938',
    title: '模块',
    catalog: '2.1.14',
  },
  {
    index: '45',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260576204194144',
    title: 'Java核心类',
    catalog: '2.2',
  },
  {
    index: '46',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260469698963456',
    title: '字符串和编码',
    catalog: '2.2.1',
  },
  {
    index: '47',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260471862687712',
    title: 'StringBuilder',
    catalog: '2.2.2',
  },
  {
    index: '48',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1271993169413952',
    title: 'StringJoiner',
    catalog: '2.2.3',
  },
  {
    index: '49',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260473794166400',
    title: '包装类型',
    catalog: '2.2.4',
  },
  {
    index: '50',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260474416351680',
    title: 'JavaBean',
    catalog: '2.2.5',
  },
  {
    index: '51',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260473188087424',
    title: '枚举类',
    catalog: '2.2.6',
  },
  {
    index: '52',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1331429187256353',
    title: '记录类',
    catalog: '2.2.7',
  },
  {
    index: '53',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1279767986831393',
    title: 'BigInteger',
    catalog: '2.2.8',
  },
  {
    index: '54',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1279768011997217',
    title: 'BigDecimal',
    catalog: '2.2.9',
  },
  {
    index: '55',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1260473555087392',
    title: '常用工具类',
    catalog: '2.2.10',
  },
  {
    index: '56',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255943543190176',
    title: '异常处理',
    catalog: '3',
  },
  {
    index: '57',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264734349295520',
    title: 'Java的异常',
    catalog: '3.1',
  },
  {
    index: '58',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264738442933472',
    title: '捕获异常',
    catalog: '3.2',
  },
  {
    index: '59',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264738764506656',
    title: '抛出异常',
    catalog: '3.3',
  },
  {
    index: '60',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264737765214592',
    title: '自定义异常',
    catalog: '3.4',
  },
  {
    index: '61',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1337645544243233',
    title: 'NullPointerException',
    catalog: '3.5',
  },
  {
    index: '62',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264740093521088',
    title: '使用断言',
    catalog: '3.6',
  },
  {
    index: '63',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264738568571776',
    title: '使用JDK Logging',
    catalog: '3.7',
  },
  {
    index: '64',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264738932870688',
    title: '使用Commons Logging',
    catalog: '3.8',
  },
  {
    index: '65',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264739436350112',
    title: '使用Log4j',
    catalog: '3.9',
  },
  {
    index: '66',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264739155914176',
    title: '使用SLF4J和Logback',
    catalog: '3.10',
  },
  {
    index: '67',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255945147512512',
    title: '反射',
    catalog: '4',
  },
  {
    index: '68',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264799402020448',
    title: 'Class类',
    catalog: '4.1',
  },
  {
    index: '69',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264803033837024',
    title: '访问字段',
    catalog: '4.2',
  },
  {
    index: '70',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264803678201760',
    title: '调用方法',
    catalog: '4.3',
  },
  {
    index: '71',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264802263123712',
    title: '调用构造方法',
    catalog: '4.4',
  },
  {
    index: '72',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264804244564000',
    title: '获取继承关系',
    catalog: '4.5',
  },
  {
    index: '73',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264804593397984',
    title: '动态代理',
    catalog: '4.6',
  },
  {
    index: '74',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255945389098144',
    title: '注解',
    catalog: '5',
  },
  {
    index: '75',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265102413966176',
    title: '使用注解',
    catalog: '5.1',
  },
  {
    index: '76',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265102803921888',
    title: '定义注解',
    catalog: '5.2',
  },
  {
    index: '77',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265102026065728',
    title: '处理注解',
    catalog: '5.3',
  },
  {
    index: '78',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255945193293888',
    title: '泛型',
    catalog: '6',
  },
  {
    index: '79',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265102638843296',
    title: '什么是泛型',
    catalog: '6.1',
  },
  {
    index: '80',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265103567584000',
    title: '使用泛型',
    catalog: '6.2',
  },
  {
    index: '81',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265105853480864',
    title: '编写泛型',
    catalog: '6.3',
  },
  {
    index: '82',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265104600263968',
    title: '擦拭法',
    catalog: '6.4',
  },
  {
    index: '83',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265105899616928',
    title: 'extends通配符',
    catalog: '6.5',
  },
  {
    index: '84',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265105920586976',
    title: 'super通配符',
    catalog: '6.6',
  },
  {
    index: '85',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265105940850016',
    title: '泛型和反射',
    catalog: '6.7',
  },
  {
    index: '86',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255943629175808',
    title: '集合',
    catalog: '7',
  },
  {
    index: '87',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265109905179456',
    title: 'Java集合简介',
    catalog: '7.1',
  },
  {
    index: '88',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265112034799552',
    title: '使用List',
    catalog: '7.2',
  },
  {
    index: '89',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265116446975264',
    title: '编写equals方法',
    catalog: '7.3',
  },
  {
    index: '90',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265118019954528',
    title: '使用Map',
    catalog: '7.4',
  },
  {
    index: '91',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265117217944672',
    title: '编写equals和hashCode',
    catalog: '7.5',
  },
  {
    index: '92',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1300277678309410',
    title: '使用EnumMap',
    catalog: '7.6',
  },
  {
    index: '93',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265117109276544',
    title: '使用TreeMap',
    catalog: '7.7',
  },
  {
    index: '94',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265119084411136',
    title: '使用Properties',
    catalog: '7.8',
  },
  {
    index: '95',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265121225603904',
    title: '使用Set',
    catalog: '7.9',
  },
  {
    index: '96',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265121791832960',
    title: '使用Queue',
    catalog: '7.10',
  },
  {
    index: '97',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265120632401152',
    title: '使用PriorityQueue',
    catalog: '7.11',
  },
  {
    index: '98',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265122668445536',
    title: '使用Deque',
    catalog: '7.12',
  },
  {
    index: '99',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265121668997888',
    title: '使用Stack',
    catalog: '7.13',
  },
  {
    index: '100',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1265124784468736',
    title: '使用Iterator',
    catalog: '7.14',
  },
  {
    index: '101',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1299919855943714',
    title: '使用Collections',
    catalog: '7.15',
  },
  {
    index: '102',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255945227202752',
    title: 'IO',
    catalog: '8',
  },
  {
    index: '103',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1298069154955297',
    title: 'File对象',
    catalog: '8.1',
  },
  {
    index: '104',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1298069163343905',
    title: 'InputStream',
    catalog: '8.2',
  },
  {
    index: '105',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1298069169635361',
    title: 'OutputStream',
    catalog: '8.3',
  },
  {
    index: '106',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1298364142452770',
    title: 'Filter模式',
    catalog: '8.4',
  },
  {
    index: '107',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1298366336073762',
    title: '操作Zip',
    catalog: '8.5',
  },
  {
    index: '108',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1298366384308257',
    title: '读取classpath资源',
    catalog: '8.6',
  },
  {
    index: '109',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1298366845681698',
    title: '序列化',
    catalog: '8.7',
  },
  {
    index: '110',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1298366902304801',
    title: 'Reader',
    catalog: '8.8',
  },
  {
    index: '111',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1298366912790561',
    title: 'Writer',
    catalog: '8.9',
  },
  {
    index: '112',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1302299230076961',
    title: 'PrintStream和PrintWriter',
    catalog: '8.10',
  },
  {
    index: '113',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1375100746072098',
    title: '使用Files',
    catalog: '8.11',
  },
  {
    index: '114',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255943660631584',
    title: '日期与时间',
    catalog: '9',
  },
  {
    index: '115',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1298613246361634',
    title: '基本概念',
    catalog: '9.1',
  },
  {
    index: '116',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1303791989162017',
    title: 'Date和Calendar',
    catalog: '9.2',
  },
  {
    index: '117',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1303871087444002',
    title: 'LocalDateTime',
    catalog: '9.3',
  },
  {
    index: '118',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1303904694304801',
    title: 'ZonedDateTime',
    catalog: '9.4',
  },
  {
    index: '119',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1303985694703650',
    title: 'DateTimeFormatter',
    catalog: '9.5',
  },
  {
    index: '120',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1303905346519074',
    title: 'Instant',
    catalog: '9.6',
  },
  {
    index: '121',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1303978948165666',
    title: '最佳实践',
    catalog: '9.7',
  },
  {
    index: '122',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255945269146912',
    title: '单元测试',
    catalog: '10',
  },
  {
    index: '123',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304048154181666',
    title: '编写JUnit测试',
    catalog: '10.1',
  },
  {
    index: '124',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304049490067490',
    title: '使用Fixture',
    catalog: '10.2',
  },
  {
    index: '125',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304064312737826',
    title: '异常测试',
    catalog: '10.3',
  },
  {
    index: '126',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304073489874978',
    title: '条件测试',
    catalog: '10.4',
  },
  {
    index: '127',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304065789132833',
    title: '参数化测试',
    catalog: '10.5',
  },
  {
    index: '128',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255945288020320',
    title: '正则表达式',
    catalog: '11',
  },
  {
    index: '129',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304066130968610',
    title: '正则表达式简介',
    catalog: '11.1',
  },
  {
    index: '130',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304066080636961',
    title: '匹配规则',
    catalog: '11.2',
  },
  {
    index: '131',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306046675025953',
    title: '复杂匹配规则',
    catalog: '11.3',
  },
  {
    index: '132',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306046706483233',
    title: '分组匹配',
    catalog: '11.4',
  },
  {
    index: '133',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306046731649057',
    title: '非贪婪匹配',
    catalog: '11.5',
  },
  {
    index: '134',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306046817632290',
    title: '搜索和替换',
    catalog: '11.6',
  },
  {
    index: '135',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255943717668160',
    title: '加密与安全',
    catalog: '12',
  },
  {
    index: '136',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304227703947297',
    title: '编码算法',
    catalog: '12.1',
  },
  {
    index: '137',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304227729113121',
    title: '哈希算法',
    catalog: '12.2',
  },
  {
    index: '138',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1305362418368545',
    title: 'BouncyCastle',
    catalog: '12.3',
  },
  {
    index: '139',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1305366354722849',
    title: 'Hmac算法',
    catalog: '12.4',
  },
  {
    index: '140',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304227762667553',
    title: '对称加密算法',
    catalog: '12.5',
  },
  {
    index: '141',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304227859136546',
    title: '口令加密算法',
    catalog: '12.6',
  },
  {
    index: '142',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304227905273889',
    title: '密钥交换算法',
    catalog: '12.7',
  },
  {
    index: '143',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304227873816610',
    title: '非对称加密算法',
    catalog: '12.8',
  },
  {
    index: '144',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304227943022626',
    title: '签名算法',
    catalog: '12.9',
  },
  {
    index: '145',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304227968188450',
    title: '数字证书',
    catalog: '12.10',
  },
  {
    index: '146',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255943750561472',
    title: '多线程',
    catalog: '13',
  },
  {
    index: '147',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304521607217185',
    title: '多线程基础',
    catalog: '13.1',
  },
  {
    index: '148',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306580710588449',
    title: '创建新线程',
    catalog: '13.2',
  },
  {
    index: '149',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306580742045730',
    title: '线程的状态',
    catalog: '13.3',
  },
  {
    index: '150',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306580767211554',
    title: '中断线程',
    catalog: '13.4',
  },
  {
    index: '151',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306580788183074',
    title: '守护线程',
    catalog: '13.5',
  },
  {
    index: '152',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306580844806178',
    title: '线程同步',
    catalog: '13.6',
  },
  {
    index: '153',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306580867874849',
    title: '同步方法',
    catalog: '13.7',
  },
  {
    index: '154',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306580888846370',
    title: '死锁',
    catalog: '13.8',
  },
  {
    index: '155',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306580911915042',
    title: '使用wait和notify',
    catalog: '13.9',
  },
  {
    index: '156',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306580960149538',
    title: '使用ReentrantLock',
    catalog: '13.10',
  },
  {
    index: '157',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306581033549858',
    title: '使用Condition',
    catalog: '13.11',
  },
  {
    index: '158',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306581002092578',
    title: '使用ReadWriteLock',
    catalog: '13.12',
  },
  {
    index: '159',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1309138673991714',
    title: '使用StampedLock',
    catalog: '13.13',
  },
  {
    index: '160',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1501424189964323',
    title: '使用Semaphore',
    catalog: '13.14',
  },
  {
    index: '161',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306581060812834',
    title: '使用Concurrent集合',
    catalog: '13.15',
  },
  {
    index: '162',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306581083881506',
    title: '使用Atomic',
    catalog: '13.16',
  },
  {
    index: '163',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306581130018849',
    title: '使用线程池',
    catalog: '13.17',
  },
  {
    index: '164',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306581155184674',
    title: '使用Future',
    catalog: '13.18',
  },
  {
    index: '165',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306581182447650',
    title: '使用CompletableFuture',
    catalog: '13.19',
  },
  {
    index: '166',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306581226487842',
    title: '使用ForkJoin',
    catalog: '13.20',
  },
  {
    index: '167',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1306581251653666',
    title: '使用ThreadLocal',
    catalog: '13.21',
  },
  {
    index: '168',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1501390373388322',
    title: '使用虚拟线程',
    catalog: '13.22',
  },
  {
    index: '169',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255945359327200',
    title: 'Maven基础',
    catalog: '14',
  },
  {
    index: '170',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1309301146648610',
    title: 'Maven介绍',
    catalog: '14.1',
  },
  {
    index: '171',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1309301178105890',
    title: '依赖管理',
    catalog: '14.2',
  },
  {
    index: '172',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1309301196980257',
    title: '构建流程',
    catalog: '14.3',
  },
  {
    index: '173',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1309301217951777',
    title: '使用插件',
    catalog: '14.4',
  },
  {
    index: '174',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1309301243117601',
    title: '模块管理',
    catalog: '14.5',
  },
  {
    index: '175',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1305148057976866',
    title: '使用mvnw',
    catalog: '14.6',
  },
  {
    index: '176',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1347981037010977',
    title: '发布Artifact',
    catalog: '14.7',
  },
  {
    index: '177',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255945371526048',
    title: '网络编程',
    catalog: '15',
  },
  {
    index: '178',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1305163149082658',
    title: '网络编程基础',
    catalog: '15.1',
  },
  {
    index: '179',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1305207629676577',
    title: 'TCP编程',
    catalog: '15.2',
  },
  {
    index: '180',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1319099802058785',
    title: 'UDP编程',
    catalog: '15.3',
  },
  {
    index: '181',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1319099923693601',
    title: '发送Email',
    catalog: '15.4',
  },
  {
    index: '182',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1319099948859426',
    title: '接收Email',
    catalog: '15.5',
  },
  {
    index: '183',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1319099982413858',
    title: 'HTTP编程',
    catalog: '15.6',
  },
  {
    index: '184',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1323711850348577',
    title: 'RMI远程调用',
    catalog: '15.7',
  },
  {
    index: '185',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255945389334784',
    title: 'XML与JSON',
    catalog: '16',
  },
  {
    index: '186',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1305161429418018',
    title: 'XML简介',
    catalog: '16.1',
  },
  {
    index: '187',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1320414976409634',
    title: '使用DOM',
    catalog: '16.2',
  },
  {
    index: '188',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1320418577219618',
    title: '使用SAX',
    catalog: '16.3',
  },
  {
    index: '189',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1320418596093986',
    title: '使用Jackson',
    catalog: '16.4',
  },
  {
    index: '190',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1320418650619938',
    title: '使用JSON',
    catalog: '16.5',
  },
  {
    index: '191',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255943820274272',
    title: 'JDBC编程',
    catalog: '17',
  },
  {
    index: '192',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1305152088703009',
    title: 'JDBC简介',
    catalog: '17.1',
  },
  {
    index: '193',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1321748435828770',
    title: 'JDBC查询',
    catalog: '17.2',
  },
  {
    index: '194',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1321748475674658',
    title: 'JDBC更新',
    catalog: '17.3',
  },
  {
    index: '195',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1321748500840481',
    title: 'JDBC事务',
    catalog: '17.4',
  },
  {
    index: '196',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1322290857902113',
    title: 'JDBC Batch',
    catalog: '17.5',
  },
  {
    index: '197',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1321748528103458',
    title: 'JDBC连接池',
    catalog: '17.6',
  },
  {
    index: '198',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255943847278976',
    title: '函数式编程',
    catalog: '18',
  },
  {
    index: '199',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1305158055100449',
    title: 'Lambda基础',
    catalog: '18.1',
  },
  {
    index: '200',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1305207799545890',
    title: '方法引用',
    catalog: '18.2',
  },
  {
    index: '201',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1322402873081889',
    title: '使用Stream',
    catalog: '18.3',
  },
  {
    index: '202',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1322655160467490',
    title: '创建Stream',
    catalog: '18.3.1',
  },
  {
    index: '203',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1322402942287906',
    title: '使用map',
    catalog: '18.3.2',
  },
  {
    index: '204',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1322402956967969',
    title: '使用filter',
    catalog: '18.3.3',
  },
  {
    index: '205',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1322402971648033',
    title: '使用reduce',
    catalog: '18.3.4',
  },
  {
    index: '206',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1322656099991586',
    title: '输出集合',
    catalog: '18.3.5',
  },
  {
    index: '207',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1322403061825570',
    title: '其他操作',
    catalog: '18.3.6',
  },
  {
    index: '208',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1264742167474528',
    title: '设计模式',
    catalog: '19',
  },
  {
    index: '209',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319090782242',
    title: '创建型模式',
    catalog: '19.1',
  },
  {
    index: '210',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319170474017',
    title: '工厂方法',
    catalog: '19.1.1',
  },
  {
    index: '211',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319134822433',
    title: '抽象工厂',
    catalog: '19.1.2',
  },
  {
    index: '212',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319155793953',
    title: '生成器',
    catalog: '19.1.3',
  },
  {
    index: '213',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319195639841',
    title: '原型',
    catalog: '19.1.4',
  },
  {
    index: '214',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319214514210',
    title: '单例',
    catalog: '19.1.5',
  },
  {
    index: '215',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319233388578',
    title: '结构型模式',
    catalog: '19.2',
  },
  {
    index: '216',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319245971489',
    title: '适配器',
    catalog: '19.2.1',
  },
  {
    index: '217',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319266943009',
    title: '桥接',
    catalog: '19.2.2',
  },
  {
    index: '218',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319283720226',
    title: '组合',
    catalog: '19.2.3',
  },
  {
    index: '219',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319302594594',
    title: '装饰器',
    catalog: '19.2.4',
  },
  {
    index: '220',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319346634785',
    title: '外观',
    catalog: '19.2.5',
  },
  {
    index: '221',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319417937953',
    title: '享元',
    catalog: '19.2.6',
  },
  {
    index: '222',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319432618017',
    title: '代理',
    catalog: '19.2.7',
  },
  {
    index: '223',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319453589538',
    title: '行为型模式',
    catalog: '19.3',
  },
  {
    index: '224',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319474561057',
    title: '责任链',
    catalog: '19.3.1',
  },
  {
    index: '225',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319491338273',
    title: '命令',
    catalog: '19.3.2',
  },
  {
    index: '226',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319508115489',
    title: '解释器',
    catalog: '19.3.3',
  },
  {
    index: '227',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319524892705',
    title: '迭代器',
    catalog: '19.3.4',
  },
  {
    index: '228',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319541669922',
    title: '中介',
    catalog: '19.3.5',
  },
  {
    index: '229',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319562641441',
    title: '备忘录',
    catalog: '19.3.6',
  },
  {
    index: '230',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319577321505',
    title: '观察者',
    catalog: '19.3.7',
  },
  {
    index: '231',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319592001569',
    title: '状态',
    catalog: '19.3.8',
  },
  {
    index: '232',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319606681634',
    title: '策略',
    catalog: '19.3.9',
  },
  {
    index: '233',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319636041762',
    title: '模板方法',
    catalog: '19.3.10',
  },
  {
    index: '234',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1281319659110433',
    title: '访问者',
    catalog: '19.3.11',
  },
  {
    index: '235',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1255945497738400',
    title: 'Web开发',
    catalog: '20',
  },
  {
    index: '236',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304265903570978',
    title: 'Web基础',
    catalog: '20.1',
  },
  {
    index: '237',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304265949708322',
    title: 'Servlet入门',
    catalog: '20.2',
  },
  {
    index: '238',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1266264743830016',
    title: 'Servlet开发',
    catalog: '20.3',
  },
  {
    index: '239',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1328705066500130',
    title: 'Servlet进阶',
    catalog: '20.4',
  },
  {
    index: '240',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1328761739935778',
    title: '重定向与转发',
    catalog: '20.4.1',
  },
  {
    index: '241',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1328768897515553',
    title: '使用Session和Cookie',
    catalog: '20.4.2',
  },
  {
    index: '242',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1266262958498784',
    title: 'JSP开发',
    catalog: '20.5',
  },
  {
    index: '243',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1266264917931808',
    title: 'MVC开发',
    catalog: '20.6',
  },
  {
    index: '244',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1337408645759009',
    title: 'MVC高级开发',
    catalog: '20.7',
  },
  {
    index: '245',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1266264823560128',
    title: '使用Filter',
    catalog: '20.8',
  },
  {
    index: '246',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1328976435871777',
    title: '修改请求',
    catalog: '20.8.1',
  },
  {
    index: '247',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1328976456843298',
    title: '修改响应',
    catalog: '20.8.2',
  },
  {
    index: '248',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304266123771937',
    title: '使用Listener',
    catalog: '20.9',
  },
  {
    index: '249',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304266260086817',
    title: '部署',
    catalog: '20.10',
  },
  {
    index: '250',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1266263217140032',
    title: 'Spring开发',
    catalog: '21',
  },
  {
    index: '251',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1266265100383840',
    title: 'IoC容器',
    catalog: '21.1',
  },
  {
    index: '252',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282381977747489',
    title: 'IoC原理',
    catalog: '21.1.1',
  },
  {
    index: '253',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282382145519649',
    title: '装配Bean',
    catalog: '21.1.2',
  },
  {
    index: '254',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282382596407330',
    title: '使用Annotation配置',
    catalog: '21.1.3',
  },
  {
    index: '255',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1308043627200545',
    title: '定制Bean',
    catalog: '21.1.4',
  },
  {
    index: '256',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282383017934882',
    title: '使用Resource',
    catalog: '21.1.5',
  },
  {
    index: '257',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282383225552930',
    title: '注入配置',
    catalog: '21.1.6',
  },
  {
    index: '258',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1308043874664482',
    title: '使用条件装配',
    catalog: '21.1.7',
  },
  {
    index: '259',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1266265125480448',
    title: '使用AOP',
    catalog: '21.2',
  },
  {
    index: '260',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1310052352786466',
    title: '装配AOP',
    catalog: '21.2.1',
  },
  {
    index: '261',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1310052317134882',
    title: '使用注解装配AOP',
    catalog: '21.2.2',
  },
  {
    index: '262',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1339039378571298',
    title: 'AOP避坑指南',
    catalog: '21.2.3',
  },
  {
    index: '263',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282383540125729',
    title: '访问数据库',
    catalog: '21.3',
  },
  {
    index: '264',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282383699509281',
    title: '使用JDBC',
    catalog: '21.3.1',
  },
  {
    index: '265',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282383642886177',
    title: '使用声明式事务',
    catalog: '21.3.2',
  },
  {
    index: '266',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282383605137441',
    title: '使用DAO',
    catalog: '21.3.3',
  },
  {
    index: '267',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1266263275862720',
    title: '集成Hibernate',
    catalog: '21.3.4',
  },
  {
    index: '268',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282383789686817',
    title: '集成JPA',
    catalog: '21.3.5',
  },
  {
    index: '269',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1331313418174498',
    title: '集成MyBatis',
    catalog: '21.3.6',
  },
  {
    index: '270',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282383340896289',
    title: '设计ORM',
    catalog: '21.3.7',
  },
  {
    index: '271',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282383877767201',
    title: '开发Web应用',
    catalog: '21.4',
  },
  {
    index: '272',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282383921807393',
    title: '使用Spring MVC',
    catalog: '21.4.1',
  },
  {
    index: '273',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282384941023266',
    title: '使用REST',
    catalog: '21.4.2',
  },
  {
    index: '274',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282384114745378',
    title: '集成Filter',
    catalog: '21.4.3',
  },
  {
    index: '275',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1347180610715681',
    title: '使用Interceptor',
    catalog: '21.4.4',
  },
  {
    index: '276',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282384360112162',
    title: '处理CORS',
    catalog: '21.4.5',
  },
  {
    index: '277',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282384236380194',
    title: '国际化',
    catalog: '21.4.6',
  },
  {
    index: '278',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282384506912802',
    title: '异步处理',
    catalog: '21.4.7',
  },
  {
    index: '279',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282384966189089',
    title: '使用WebSocket',
    catalog: '21.4.8',
  },
  {
    index: '280',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282385643569186',
    title: '集成第三方组件',
    catalog: '21.5',
  },
  {
    index: '281',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282385704386594',
    title: '集成JavaMail',
    catalog: '21.5.1',
  },
  {
    index: '282',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304266721460258',
    title: '集成JMS',
    catalog: '21.5.2',
  },
  {
    index: '283',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282385878450210',
    title: '使用Scheduler',
    catalog: '21.5.3',
  },
  {
    index: '284',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282385687609378',
    title: '集成JMX',
    catalog: '21.5.4',
  },
  {
    index: '285',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1266265175882464',
    title: 'Spring Boot开发',
    catalog: '22',
  },
  {
    index: '286',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282386201411617',
    title: '第一个Spring Boot应用',
    catalog: '22.1',
  },
  {
    index: '287',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282386532761633',
    title: '使用开发者工具',
    catalog: '22.2',
  },
  {
    index: '288',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282386595676193',
    title: '打包Spring Boot应用',
    catalog: '22.3',
  },
  {
    index: '289',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304267002478625',
    title: '瘦身Spring Boot应用',
    catalog: '22.4',
  },
  {
    index: '290',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282386381766689',
    title: '使用Actuator',
    catalog: '22.5',
  },
  {
    index: '291',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282388483112993',
    title: '使用Profiles',
    catalog: '22.6',
  },
  {
    index: '292',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282386318852129',
    title: '使用Conditional',
    catalog: '22.7',
  },
  {
    index: '293',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1304267426103329',
    title: '加载配置文件',
    catalog: '22.8',
  },
  {
    index: '294',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282389045149729',
    title: '禁用自动配置',
    catalog: '22.9',
  },
  {
    index: '295',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282389221310497',
    title: '添加Filter',
    catalog: '22.10',
  },
  {
    index: '296',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282389200338977',
    title: '集成第三方组件',
    catalog: '22.11',
  },
  {
    index: '297',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1283318525984802',
    title: '集成Open API',
    catalog: '22.11.1',
  },
  {
    index: '298',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282386499207201',
    title: '访问Redis',
    catalog: '22.11.2',
  },
  {
    index: '299',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282388602650658',
    title: '集成Artemis',
    catalog: '22.11.3',
  },
  {
    index: '300',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282385960239138',
    title: '集成RabbitMQ',
    catalog: '22.11.4',
  },
  {
    index: '301',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1282388443267106',
    title: '集成Kafka',
    catalog: '22.11.5',
  },
  {
    index: '302',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1266263401691296',
    title: 'Spring Cloud开发',
    catalog: '23',
  },
  {
    index: '303',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1492032577077281',
    title: '项目架构设计',
    catalog: '23.1',
  },
  {
    index: '304',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1490560363790369',
    title: '搭建项目框架',
    catalog: '23.2',
  },
  {
    index: '305',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1491662232616993',
    title: '设计交易引擎',
    catalog: '23.3',
  },
  {
    index: '306',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1491808051789856',
    title: '设计资产系统',
    catalog: '23.3.1',
  },
  {
    index: '307',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1491808154550304',
    title: '设计订单系统',
    catalog: '23.3.2',
  },
  {
    index: '308',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1491662270365728',
    title: '设计撮合引擎',
    catalog: '23.3.3',
  },
  {
    index: '309',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1491808179716128',
    title: '设计清算系统',
    catalog: '23.3.4',
  },
  {
    index: '310',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1492754649579557',
    title: '完成交易引擎',
    catalog: '23.3.5',
  },
  {
    index: '311',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1491662199062560',
    title: '设计定序系统',
    catalog: '23.4',
  },
  {
    index: '312',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1493043121225765',
    title: '设计API系统',
    catalog: '23.5',
  },
  {
    index: '313',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1491662255685664',
    title: '设计行情系统',
    catalog: '23.6',
  },
  {
    index: '314',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1491662276657184',
    title: '设计推送系统',
    catalog: '23.7',
  },
  {
    index: '315',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1491662245199904',
    title: '编写UI',
    catalog: '23.8',
  },
  {
    index: '316',
    level: '##',
    url: 'https://www.liaoxuefeng.com/wiki/1252599548343744/1493054808653860',
    title: '项目总结',
    catalog: '23.9',
  },
];

// 日志
let logs = fs.readFileSync('./logs.txt').toString().split(',');
fs.writeFile('./logs.txt', '', {}, (error) => {
  if (error) {
    return console.error(error);
  }
});

list.forEach((params) => {
  const { level, title, url, catalog } = params;
  // 检测上一次执行情况
  if (logs.includes(catalog) === false) {
    return false;
  } else {
    console.log(`获取: ${catalog} ${title}`);
  }

  const req = http.request(options, (res) => {
    const chunks = [];

    res.on('data', (chunk) => {
      chunks.push(chunk);
    });

    res.on('end', () => {
      const body = Buffer.concat(chunks);
      // console.log(body);

      let data = {
        markdown: '',
        content: '',
      };

      try {
        data = JSON.parse(body.toString());
        // console.log(data);
      } catch (error) {
        fs.writeFileSync('./logs.txt', `${catalog},`, { flag: 'a' });
        console.error(`${catalog} ${title}`, error);
      }

      const images = data.content.match(/<img\ssrc="[\w\/:.]+"\sdata-src="[\w\/]+"\salt="[\w-]+">/g) || [];

      let markdown = data.markdown;

      images.forEach((image) => {
        const [load, src, alt] = image
          .replace(/<img\ssrc="([\w\/:.]+)"\sdata-src="([\w\/]+)"\salt="([\w-]+)">/, '$1;$2;$3')
          .split(';');
        markdown = markdown.replace(`![${alt}](${load})`, `![${alt}](https://www.liaoxuefeng.com${src})`);
      });

      markdown = `${level} ${catalog} ${title}\n\n${markdown}`;
      markdown = markdown
        .replace(/```x-java/g, '```java')
        .replace(/```auto/g, '```java')
        .replace(/`([\w\s,.:!~''-=@#%&<>\+\?\(\)\[\]]+)`/g, ' `$1` ')
        .replace(/“/g, ' “')
        .replace(/”/g, '” ')
        .replace(/----/g, '');
      // console.log(markdown);

      const dir = output(catalog);
      fs.mkdirSync(dir, { recursive: true });
      fs.writeFile(dir + 'README.md', markdown, {}, (error) => {
        if (error) {
          return console.error(error);
        }

        console.log(`输出: ${catalog} ${title}`);
      });
    });
  });

  req.write(
    JSON.stringify({
      url,
    })
  );

  req.end();
});

function output(catalog) {
  const level = ['a', 'b', 'c', 'd'];
  let output = './docs/';

  if (catalog == '') return output;

  const dir = catalog.split('.');
  // console.log(dir);

  dir.forEach((number, index) => {
    output += level[index] + number.padStart(2, '0') + '/';
  });
  // console.log(output);

  return output;
}
